﻿using System;

namespace Sgr.Oss
{
    public class LocalFilesystemOptions
    {
        private int _bucketPartitionCount = 100;
        private int _objectPartitionCount = 256;
        private int _maxFilesPerDirectory = 10000;
        private string _workDir = "oss_data";
        private string _baseUrl = "";
        private string _signKey = "";

        /// <summary>
        /// 标识 WorkDir 指示的是否为相对路径
        /// </summary>
        public bool IsRelativePath { get; set; } = true;

        /// <summary>
        /// 工作目录
        /// 限制：不能为空，长度不能超过260个字符
        /// </summary>
        public string WorkDir
        {
            get => _workDir;
            set
            {
                _workDir = value;
            }
        }

        /// <summary>
        /// 存储桶分区数量
        /// 限制：1-999之间的整数
        /// </summary>
        public int BucketPartitionCount
        {
            get => _bucketPartitionCount;
            set
            {
                _bucketPartitionCount = value;
            }
        }

        /// <summary>
        /// 对象分区数量
        /// 限制：1-999之间的整数
        /// </summary>
        public int ObjectPartitionCount
        {
            get => _objectPartitionCount;
            set
            {
                _objectPartitionCount = value;
            }
        }

        /// <summary>
        /// 单个目录最大文件数量
        /// 限制：1-100000之间的整数
        /// </summary>
        public int MaxFilesPerDirectory
        {
            get => _maxFilesPerDirectory;
            set
            {
                _maxFilesPerDirectory = value;
            }
        }

        /// <summary>
        /// 对外访问的基础URL
        /// 限制：必须是有效的URL格式
        /// </summary>
        public string BaseUrl
        {
            get => _baseUrl;
            set
            {
                _baseUrl = value;
            }
        }

        /// <summary>
        /// 用于签名的密钥
        /// 限制：不能为空，长度至少8个字符
        /// </summary>
        public string SignKey
        {
            get => _signKey;
            set
            {
                _signKey = value;
            }
        }
    }
}